home *** CD-ROM | disk | FTP | other *** search
Text File | 2003-07-17 | 29.7 KB | 1,024 lines |
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- global int $reflectionXTurnedOff = false ;
- global int $reflectionYTurnedOff = false ;
- global int $reflectionZTurnedOff = false ;
-
- global proc deletePopupMenu()
- {
- if( `popupMenu -q -exists tempMM` ) {
- deleteUI tempMM;
- }
-
- if( `popupMenu -q -exists tempMM2` ) {
- deleteUI tempMM2;
- }
- }
-
- proc string currentToolClass()
- {
- string $currentContext = `currentCtx`;
- return `contextInfo -c $currentContext`;
- }
-
- proc string jasperCommand()
- {
- string $currentTool = currentToolClass();
-
- string $jasperCmd = "";
-
- if ( $currentTool == "putty" ) {
- $jasperCmd = "puttyCtx";
- }
- else if ( $currentTool == "selectPaint" ) {
- $jasperCmd = "selectPaintCtx";
- }
- else if ( $currentTool == "userPaint" ) {
- $jasperCmd = "userPaintCtx";
- }
- else if ( $currentTool == "attrPaint"
- || attrPaintInstCheckTool($currentTool) ) {
- $jasperCmd = "attrPaintCtx";
- }
- else if ( $currentTool == "wtPaint" ) {
- $jasperCmd = "wtPaintCtx";
- }
- else if ( $currentTool == "setEditPaint" ) {
- $jasperCmd = "setEditPaintCtx";
- }
- else if ( $currentTool == "paintColor" ) {
- $jasperCmd = "paintColorCtx";
- }
-
- return $jasperCmd;
- }
-
- proc int isAdynPaintPanel()
- {
- string $currentPanel = `getPanel -withFocus`;
- return (`scriptedPanel -ex $currentPanel` &&
- `scriptedPanel -q -type $currentPanel` == "dynPaintScriptedPanelType");
- }
-
- proc int isDynWireContext()
- {
- string $cc = `currentCtx`;
- string $ct = `contextInfo -t $cc`;
-
- return ($ct == "Paint Effects");
- }
-
- proc int isCommonPaintCtx()
- {
- string $tc = currentToolClass();
-
- return $tc == "putty" || $tc == "selectPaint"
- || $tc == "userPaint" || $tc == "wtPaint"
- || $tc == "setEditPaint" || $tc == "attrPaint"
- || $tc == "paintColor"
- || attrPaintInstCheckTool($tc);
- }
-
- proc int isSurfacePaintCtx()
- {
- string $tc = currentToolClass();
-
- return $tc == "putty"
- || $tc == "userPaint" || $tc == "wtPaint" || $tc == "attrPaint"
- || attrPaintInstCheckTool($tc);
- }
-
- proc int isPuttyCtx()
- {
- string $tc = currentToolClass();
-
- return $tc == "putty";
- }
-
- proc int isValuePaintCtx()
- {
- string $tc = currentToolClass();
-
- return $tc == "userPaint" || $tc == "wtPaint" || $tc == "attrPaint"
- || attrPaintInstCheckTool($tc);
- }
-
- proc int isWtPaintCtx()
- {
- string $tc = currentToolClass();
-
- return $tc == "wtPaint";
- }
-
-
- proc int isSetEditPaintCtx()
- {
- string $tc = currentToolClass();
-
- return $tc == "setEditPaint";
- }
-
- proc int isPaintColorCtx()
- {
- string $tc = currentToolClass();
- return $tc == "paintColor";
- }
-
- global proc increaseBrushRadius( )
- {
- string $jasperCmd = jasperCommand();
-
- if ( $jasperCmd != "" ) {
- // we have to make sure that we are not increasing
- // the radius beyond the uppper limit
- float $radius = eval( $jasperCmd + " -q -radius `currentCtx`" );
- $radius = 1.1 * $radius;
- if ( $radius > 50.0 ) { $radius = 50.0; }
- $cmd = $jasperCmd + " -e -radius " + $radius + " `currentCtx`";
- eval( $cmd );
- }
- }
-
- global proc decreaseBrushRadius( )
- {
- string $jasperCmd = jasperCommand();
-
- if ( $jasperCmd != "" ) {
- // we have to make sure that we are not decreasing
- // the radius beyond the lower limit
- float $radius = eval( $jasperCmd + " -q -radius `currentCtx`" );
- float $lowerRadius = eval( $jasperCmd + " -q -lowerradius `currentCtx`" );
-
- $radius = 0.9 * $radius;
- if ( $radius < $lowerRadius ) { $radius = $lowerRadius; }
- $cmd = $jasperCmd + " -e -radius " + $radius + " `currentCtx`";
- eval( $cmd );
- }
- }
-
- global proc toggleReflection()
- {
- source "artisanNamedCommandSetup.mel" ;
-
- global int $reflectionXTurnedOff ;
- global int $reflectionYTurnedOff ;
- global int $reflectionZTurnedOff ;
-
- if ( isArtisanCtx() ) {
- string $artCmd = artisanCommand();
- if ( $artCmd != "" ) {
- string $curContext = `currentCtx` ;
-
- // is any reflection turned on ?
- // if Yes, turn off what ever is turned on and make a note of it.
- // if No, turn on what ever was last turned off by using this command
- string $cmd0 = $artCmd + " -q -reflectX `currentCtx`";
- string $cmd1 = $artCmd + " -q -reflectY `currentCtx`";
- string $cmd2 = $artCmd + " -q -reflectZ `currentCtx`";
-
- int $reflectX = eval($cmd0) ;
- int $reflectY = eval($cmd1) ;
- int $reflectZ = eval($cmd2) ;
-
- if ( $reflectX == true || $reflectY == true || $reflectZ == true) {
- if ( $reflectX ) {
- $cmd0 = $artCmd + " -e -reflectX false `currentCtx`";
- eval($cmd0) ;
- $reflectionXTurnedOff = true ;
- }
- if ( $reflectY ) {
- $cmd0 = $artCmd + " -e -reflectY false `currentCtx`";
- eval($cmd0) ;
- $reflectionYTurnedOff = true ;
- }
- if ( $reflectZ ) {
- $cmd0 = $artCmd + " -e -reflectZ false `currentCtx`";
- eval($cmd0) ;
- $reflectionZTurnedOff = true ;
- }
-
- // Update the UI in artisan tools.
- if ( `checkBoxGrp -exists artReflectionChBox` ) {
- checkBoxGrp -e -v1 0 -v2 0 -v3 0 artReflectionChBox;
- }
- // Update the UI in 3d Paint tool.
- if ( `checkBoxGrp -exists art3dReflectionChBox` ) {
- checkBoxGrp -e -v1 0 -v2 0 -v3 0 art3dReflectionChBox;
- }
- } else {
- if( $reflectionXTurnedOff ) {
- $cmd0 = $artCmd + " -e -reflectX true `currentCtx`";
- eval($cmd0) ;
- }
- if( $reflectionYTurnedOff ) {
- $cmd0 = $artCmd + " -e -reflectY true `currentCtx`";
- eval($cmd0) ;
- }
- if( $reflectionZTurnedOff ) {
- $cmd0 = $artCmd + " -e -reflectZ true `currentCtx`";
- eval($cmd0) ;
- }
-
- // Update the UI in artisan tools.
- if ( `checkBoxGrp -exists artReflectionChBox` ) {
- checkBoxGrp -e -va3 $reflectionXTurnedOff $reflectionYTurnedOff $reflectionZTurnedOff artReflectionChBox;
- }
- // Update the UI in 3d Paint tool.
- if ( `checkBoxGrp -exists art3dReflectionChBox` ) {
- checkBoxGrp -e -va3 $reflectionXTurnedOff $reflectionYTurnedOff $reflectionZTurnedOff art3dReflectionChBox;
- }
-
- $reflectionXTurnedOff = false ;
- $reflectionYTurnedOff = false ;
- $reflectionZTurnedOff = false ;
- }
- }
- } else {
-
- string $jasperCmd = jasperCommand();
-
- if ( $jasperCmd != "" ) {
-
- string $cmd = ($jasperCmd + " -q -reflectpaint `currentCtx`");
-
- if ( eval($cmd) ) {
- eval( $jasperCmd + " -e -reflectpaint false `currentCtx`" );
- }
- else {
- eval( $jasperCmd + " -e -reflectpaint true `currentCtx`" );
- }
- }
- }
- }
-
- global proc toggleInvertReflectVector()
- {
- string $jasperCmd = jasperCommand();
-
- if ( $jasperCmd != "" ) {
-
- string $cmd = ($jasperCmd + " -q -invertrefvector `currentCtx`");
-
- if ( eval($cmd) ) {
- eval( $jasperCmd + " -e -invertrefvector false `currentCtx`" );
- }
- else {
- eval( $jasperCmd + " -e -invertrefvector true `currentCtx`" );
- }
- }
- }
-
- global proc toggleActiveLines( )
- {
- string $jasperCmd = jasperCommand();
-
- if ( $jasperCmd != "" ) {
-
- string $cmd = ($jasperCmd + " -q -showactive `currentCtx`");
-
- if ( eval($cmd) ) {
- eval( $jasperCmd + " -e -showactive false `currentCtx`" );
- }
- else {
- eval( $jasperCmd + " -e -showactive true `currentCtx`" );
- }
- }
- }
-
-
- global proc toggleShowPreview( )
- {
- string $jasperCmd = jasperCommand();
-
- if ( $jasperCmd != "" ) {
-
- string $cmd = ($jasperCmd + " -q -feedback `currentCtx`");
-
- if ( eval($cmd) ) {
- eval( $jasperCmd + " -e -feedback false `currentCtx`" );
- }
- else {
- eval( $jasperCmd + " -e -feedback true `currentCtx`" );
- }
- }
- }
-
-
- global proc toggleMaskingCVs()
- {
- if ( isSurfacePaintCtx() ) {
-
- string $cmd = ("surfacePaintCtx" + " -q -maskcv `currentCtx`");
-
- if ( eval($cmd) == "off" ) {
- eval( "surfacePaintCtx" + " -e -maskcv \"select\" `currentCtx`" );
- }
- else {
- eval( "surfacePaintCtx" + " -e -maskcv \"off\" `currentCtx`" );
- }
- }
- }
-
-
- global proc changeCommonEdgeDisplay()
- {
- string $jasperCmd = jasperCommand();
-
- if ( $jasperCmd != "" ) {
-
- string $cmd = ($jasperCmd + " -q -commedgedisplay `currentCtx`");
- string $type = `eval $cmd`;
- if ( $type == "off" ) {
- eval( $jasperCmd + " -e -commedgedisplay \"one\" `currentCtx`" );
- } else if ( $type == "one" ) {
- eval( $jasperCmd + " -e -commedgedisplay \"all\" `currentCtx`" );
- } else if ( $type == "all" ) {
- eval( $jasperCmd + " -e -commedgedisplay \"off\" `currentCtx`" );
- }
- }
- }
-
- global proc toggleCommonCornersDisplay()
- {
- string $jasperCmd = jasperCommand();
-
- if ( $jasperCmd != "" )
- {
- string $cmd = ($jasperCmd + " -q -ccd `currentCtx`");
- string $type = `eval $cmd`;
- if ( $type == "off" ) {
- eval( $jasperCmd + " -e -ccd \"all\" `currentCtx`" );
- } else {
- eval( $jasperCmd + " -e -ccd \"off\" `currentCtx`" );
- }
- }
-
- }
-
- global proc floodSurfaces()
- {
- string $jasperCmd = jasperCommand();
-
- if ( $jasperCmd != "" ) {
- eval( $jasperCmd + " -e -clear `currentCtx`" );
- }
- }
-
- global proc jasperBrushReflectMode( string $jasperCmd )
- {
- string $cmd = ($jasperCmd + " -q -reflectpaint `currentCtx`");
- int $flag = eval($cmd);
- menuItem -cb $flag -label "Reflection On/Off" MM_ReflectFlag;
-
- $cmd = ($jasperCmd + " -q -invertrefvector `currentCtx`");
- $flag = eval($cmd);
- menuItem -cb $flag -label "Invert Ref. Vector" MM_InvertReflectVector;
-
- menuItem -sm true -label "Reflect Mode";
- radioMenuItemCollection;
- menuItem -rb false -label "U Dir" MM_ReflectMode_U;
- menuItem -rb false -label "V Dir" MM_ReflectMode_V;
- menuItem -rb false -label "Multiple Surf" MM_ReflectMode_Multi;
- setParent -m ..;
-
- $cmd = ($jasperCmd + " -q -reflectpainttype `currentCtx`");
- string $operation = `eval $cmd`;
- if ( $operation == "reflectU" ) {
- menuItem -e -rb true MM_ReflectMode_U;
- menuItem -e -rb false MM_ReflectMode_V;
- menuItem -e -rb false MM_ReflectMode_Multi;
- }
- else if ( $operation == "reflectV" ) {
- menuItem -e -rb false MM_ReflectMode_U;
- menuItem -e -rb true MM_ReflectMode_V;
- menuItem -e -rb false MM_ReflectMode_Multi;
- }
- else if ( $operation == "reflectMult" ) {
- menuItem -e -rb false MM_ReflectMode_U;
- menuItem -e -rb false MM_ReflectMode_V;
- menuItem -e -rb true MM_ReflectMode_Multi;
- }
-
- menuItem -e -c ("toggleReflection") MM_ReflectFlag;
- menuItem -e -c ("toggleInvertReflectVector") MM_InvertReflectVector;
- menuItem -e -c ($jasperCmd + " -e -reflectpainttype \"reflectU\" `currentCtx`")
- MM_ReflectMode_U;
- menuItem -e -c ($jasperCmd + " -e -reflectpainttype \"reflectV\" `currentCtx`")
- MM_ReflectMode_V;
- menuItem -e -c ($jasperCmd + " -e -reflectpainttype \"reflectMult\" `currentCtx`")
- MM_ReflectMode_Multi;
- }
-
- global proc puttyReferenceVectorDetails()
- {
- menuItem -rp "N" -l "Normal"
- -c ("puttyCtx -e -refvector \"normal\" `currentCtx`");
- menuItem -rp "NW" -l "First Normal"
- -c ("puttyCtx -e -refvector \"firstnormal\" `currentCtx`");
- menuItem -rp "NE" -l "View"
- -c ("puttyCtx -e -refvector \"view\" `currentCtx`");
-
- menuItem -rp "W" -l "U Direction"
- -c ("puttyCtx -e -refvector \"visoparm\" `currentCtx`");
- menuItem -rp "E" -l "V Direction"
- -c ("puttyCtx -e -refvector \"uisoparm\" `currentCtx`");
-
- menuItem -rp "SW" -l "X Axis"
- -c ("puttyCtx -e -refvector \"xaxis\" `currentCtx`");
- menuItem -rp "S" -l "Y Axis"
- -c ("puttyCtx -e -refvector \"yaxis\" `currentCtx`");
- menuItem -rp "SE" -l "Z Axis"
- -c ("puttyCtx -e -refvector \"zaxis\" `currentCtx`");
- }
-
- global proc puttyReferenceVector()
- {
- string $jasperCmd = jasperCommand();
-
- if ( $jasperCmd != "" ) {
- deletePopupMenu();
-
- if ( $jasperCmd == "puttyCtx" ) {
- popupMenu -mm 1 -b 1 -p viewPanes tempMM2;
- puttyReferenceVectorDetails();
- setParent -m ..;
- }
- }
- }
-
- proc jasperAttrPaintBrushMode( string $jasperCmd )
- {
- string $currentTool = currentToolClass();
-
- if( $currentTool != "attrPaint"
- && attrPaintInstCheckTool($currentTool) )
- {
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- if( !attrPaintInstCustomizeMM() ) {
- menuItem -rp "N" -l "Add"
- -c ($jasperCmd + " -e -et \"additive\" `currentCtx`");
- menuItem -rp "S" -l "Scale"
- -c ($jasperCmd + " -e -et \"scale\" `currentCtx`");
- menuItem -rp "W" -l "Smooth"
- -c ($jasperCmd + " -e -et \"smooth\" `currentCtx`");
- menuItem -rp "E" -l "Replace"
- -c ($jasperCmd + " -e -et \"absolute\" `currentCtx`");
- }
- jasperBrushReflectMode( $jasperCmd ) ;
- setParent -m ..;
- }
- else {
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "N" -l "Add"
- -c ($jasperCmd + " -e -et \"additive\" `currentCtx`");
- menuItem -rp "S" -l "Scale"
- -c ($jasperCmd + " -e -et \"scale\" `currentCtx`");
- menuItem -rp "W" -l "Smooth"
- -c ($jasperCmd + " -e -et \"smooth\" `currentCtx`");
- menuItem -rp "E" -l "Replace"
- -c ($jasperCmd + " -e -et \"absolute\" `currentCtx`");
- jasperBrushReflectMode( $jasperCmd ) ;
- setParent -m ..;
- }
- }
-
- global proc jasperBrushMode( )
- {
- string $jasperCmd = jasperCommand();
-
- // do nothing if in Texture Paint Tool
- if ( $jasperCmd == "paintColorCtx" ) return;
-
- if ( $jasperCmd != "" ) {
- deletePopupMenu();
-
- if ( $jasperCmd == "puttyCtx" ) {
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "N" -l "Pull"
- -c ("puttyCtx -e -mtm " + " \"pull\" `currentCtx`");
- menuItem -rp "S" -l "Push"
- -c ("puttyCtx -e -mtm " + " \"push\" `currentCtx`");
- menuItem -rp "W" -l "Smooth"
- -c ("puttyCtx -e -mtm " + " \"smooth\" `currentCtx`");
- menuItem -rp "E" -l "Erase"
- -c ("puttyCtx -e -mtm " + " \"erase\" `currentCtx`");
- jasperBrushReflectMode( $jasperCmd ) ;
- setParent -m ..;
- }
- else if ( $jasperCmd == "selectPaintCtx" ) {
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "N" -l "Toggle"
- -c ("selectPaintCtx -e -st " + " \"toggle\" `currentCtx`");
- menuItem -rp "W" -l "Select"
- -c ("selectPaintCtx -e -st " + " \"select\" `currentCtx`");
- menuItem -rp "E" -l "UnSelect"
- -c ("selectPaintCtx -e -st " + " \"unselect\" `currentCtx`");
- jasperBrushReflectMode( $jasperCmd ) ;
- setParent -m ..;
- }
- else if ( $jasperCmd == "setEditPaintCtx" ) {
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "N" -l "Transfer"
- -c ("setEditPaintCtx -e -sot " + " \"transfer\" `currentCtx`");
- menuItem -rp "W" -l "Add"
- -c ("setEditPaintCtx -e -sot " + " \"add\" `currentCtx`");
- menuItem -rp "E" -l "Remove"
- -c ("setEditPaintCtx -e -sot " + " \"remove\" `currentCtx`");
- setParent -m ..;
- }
- else if ( $jasperCmd == "attrPaintCtx" ) {
- jasperAttrPaintBrushMode( $jasperCmd );
- }
- else { // ($jasperCmd == "userPaintCtx" or $jasperCmd == "wtPaintCtx")
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "N" -l "Add"
- -c ($jasperCmd + " -e -et \"additive\" `currentCtx`");
- menuItem -rp "S" -l "Scale"
- -c ($jasperCmd + " -e -et \"scale\" `currentCtx`");
- menuItem -rp "W" -l "Smooth"
- -c ($jasperCmd + " -e -et \"smooth\" `currentCtx`");
- menuItem -rp "E" -l "Replace"
- -c ($jasperCmd + " -e -et \"absolute\" `currentCtx`");
- jasperBrushReflectMode( $jasperCmd ) ;
- setParent -m ..;
- }
- }
- }
-
-
- global proc puttyIncreaseMaxDisp( )
- {
- if ( isPuttyCtx() ) {
- // we have to make sure that we are not increasing
- // the maximum displacement beyond the upper limit
- float $maxDisp = eval( "puttyCtx -q -maxdisp `currentCtx`" );
- $maxDisp = 1.1 * $maxDisp;
- if ( $maxDisp > 5.0 ) { $maxDisp = 5.0; }
- $cmd = "puttyCtx -e -maxdisp " + $maxDisp + " `currentCtx`";
- eval( $cmd );
- }
- }
-
- global proc puttyDecreaseMaxDisp( )
- {
- if ( isPuttyCtx() ) {
- // we have to make sure that we are not decreasing
- // the maximum displacement beyond the lower limit
- float $maxDisp = eval( "puttyCtx -q -maxdisp `currentCtx`" );
- $maxDisp = 0.9 * $maxDisp;
- if ( $maxDisp < 0.0 ) { $maxDisp = 0.0; }
- $cmd = "puttyCtx -e -maxdisp " + $maxDisp + " `currentCtx`";
- eval( $cmd );
- }
- }
-
-
- global proc puttyFloodStitch( )
- {
- if ( isPuttyCtx() ) {
- puttyCtx -e -stitchedgeflood `currentCtx`;
- }
- }
-
-
- global proc puttyUpdateEraseSurface( )
- {
- if ( isPuttyCtx() ) {
- puttyCtx -e -updateerasesrf `currentCtx`;
- }
- }
-
-
- global proc puttyUpdateReferenceSurface( )
- {
- if ( isPuttyCtx() ) {
- puttyCtx -e -updaterefsrf `currentCtx`;
- }
- }
-
-
- global proc puttyToggleAutosmooth()
- {
- if ( isPuttyCtx() ) {
- string $cmd = "puttyCtx -q -autosmooth `currentCtx`";
- if ( eval($cmd) ) {
- puttyCtx -e -autosmooth false `currentCtx`;
- } else {
- puttyCtx -e -autosmooth true `currentCtx`;
- }
- }
- }
-
-
- global proc wtPaintToggleColorFeedback( )
- {
- string $jasperCmd = jasperCommand();
-
- if ( isValuePaintCtx() ) {
-
- string $cmd = "valuePaintCtx -q -colorfeedback `currentCtx`";
-
- if ( eval($cmd) ) {
- eval( "valuePaintCtx -e -colorfeedback false `currentCtx`" );
- }
- else {
- eval( "valuePaintCtx -e -colorfeedback true `currentCtx`" );
- }
- }
- }
-
- global proc activateSelectCluster()
- {
- if ( isWtPaintCtx() ) {
- wtPaintCtx -e -selectclustermode true `currentCtx`;
- }
- }
-
-
- global proc deactivateSelectCluster()
- {
- if ( isWtPaintCtx() ) {
- wtPaintCtx -e -selectclustermode false `currentCtx`;
- }
- }
-
- global proc activatePickColorMode()
- {
- commonPaintCtx -e -brushoperate "pickcolor" `currentCtx`;
- }
-
- global proc deactivatePickColorMode()
- {
- commonPaintCtx -e -brushoperate "paint" `currentCtx`;
- }
-
- proc dynPaintResize(string $sliderName)
- {
- if (isDynWireContext()) {
- dynWireCtx -e -dbs $sliderName `currentCtx`;
- }
- if (isAdynPaintPanel()) {
- global string $gDynPaintEditorName;
- dynPaintCtx -e -dbs $sliderName `dynPaintEditor -q -drc $gDynPaintEditorName`;
- }
- }
-
- // global procs for activating/deactivating screen sliders
- //
- global proc activateScreenSlider(
- string $sliderName
- )
- {
- if ( isCommonPaintCtx() ) {
- commonPaintCtx -e -slider $sliderName `currentCtx`;
- }
- if (`isTrue "MayaCreatorExists"` && (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- if( $sliderName == "displacement" ) {
- dynPaintResize("offset");
- }else if( $sliderName == "lower_radius" ) {
- dynPaintResize("width");
- }else {
- dynPaintResize("size");
- }
- }
- }
-
- global proc activateReflectIsoparmScreenSlider()
- {
- string $ctx = `currentCtx`;
-
- if ( isCommonPaintCtx()
- && eval("commonPaintCtx -q -reflectpaint " + $ctx) ) {
- string $reflectType = `commonPaintCtx -q -reflectpainttype $ctx`;
-
- if ( $reflectType == "reflectU" ) {
- commonPaintCtx -e -slider "u_reflect_isoparm" $ctx;
- } else if ( $reflectType == "reflectV" ) {
- commonPaintCtx -e -slider "v_reflect_isoparm" $ctx;
- }
- }
- }
-
- global proc deactivateScreenSlider()
- {
- if ( isCommonPaintCtx() ) {
- commonPaintCtx -e -slider "none" `currentCtx`;
- }
- if (`isTrue "MayaCreatorExists"` ) {
- dynPaintResize("none");
- }
- }
-
- global string $globalScreenSliderMode = "none";
-
- global proc setGlobalScreenSliderMode()
- {
- if ( isCommonPaintCtx() ) {
- deletePopupMenu();
-
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "N" -l "Upper Radius"
- -c "$globalScreenSliderMode = \"upper_radius\"";
- menuItem -rp "S" -l "Reflect Isoparm"
- -c "$globalScreenSliderMode = \"reflect_isoparm\"";
- if ( isSurfacePaintCtx() ) {
- menuItem -rp "W" -l "Opacity"
- -c "$globalScreenSliderMode = \"opacity\"";
- if ( isPuttyCtx() ) {
- menuItem -rp "E" -l "Displacement"
- -c "$globalScreenSliderMode = \"displacement\"";
- } else if ( isValuePaintCtx() ) {
- menuItem -rp "E" -l "Value"
- -c "$globalScreenSliderMode = \"value\"";
- }
- }
- setParent -m ..;
- }
- }
-
- global proc activateGlobalScreenSlider()
- {
- global string $globalScreenSliderMode;
-
- if ( $globalScreenSliderMode == "reflect_isoparm" ) {
- activateReflectIsoparmScreenSlider();
- if (`isTrue "MayaCreatorExists"` ) {
- dynPaintResize("size");
- }
- } else {
- activateScreenSlider( $globalScreenSliderMode );
- }
- }
-
- global proc jasperNamedCommandSetup( )
- {
- assignCommand -e -addDivider "Maya Artisan Tools";
-
-
- // =======================================================
- // Global commands - general across all the Artisan tools
- //
- // Reflection
- nameCommand -annotation "Toggle Reflection ON/OFF"
- -command ("ToggleReflection")
- ToggleReflection_in_Jasper;
-
- // Show Preview on/off
- nameCommand -annotation "Toggle Show Preview ON/OFF"
- -command ("TogglePreview")
- TogglePreview_in_Jasper;
-
- // Masking on/off
- nameCommand -annotation "Toggle Masking CVs ON/OFF"
- -command ("ToggleMaskingCVs")
- ToggleMaskingCVs_in_Jasper;
-
- // Toggle common edge display
- nameCommand -annotation "Toggle Common Edges Display Mode"
- -command ("ToggleCommonEdgesDisplay")
- ChangeCommEdgeDisplay_in_Jasper;
-
- // Toggle common corner display
- nameCommand -annotation "Toggle Common Corners Display"
- -command ("ToggleCommonCornersDisplay")
- ToggleCommCornerDisplay_in_Jasper;
-
-
- // =======================================================
- // Scuplt tool (puttyContext) name commands
- //
- // Flood Stitch
- nameCommand -annotation "Stitch Surfaces"
- -command ("FloodStitch")
- FloodStitch_in_Jasper;
-
- // Update Erase Surface
- nameCommand -annotation "Update Erase Surface"
- -command ("UpdateEraseSurface")
- UpdateEraseSurface_in_Jasper;
-
- // Update Reference Surface
- nameCommand -annotation "Update Reference Surface"
- -command ("UpdateReferenceSurface")
- UpdateReferenceSurface_in_Jasper;
-
- // Toggle Autosmooth
- nameCommand -annotation "Toggle Autosmooth"
- -command ("ToggleAutoSmooth")
- ToggleAutosmooth_in_Jasper;
-
-
- // =======================================================
- // Value tools commands
- //
- // Turn color feedback on/off
- nameCommand -annotation "Toggle Color Feedback ON/OFF"
- -command ("ToggleColorFeedback")
- ColorFeedback_in_Jasper;
-
- // Select cluster mode
- nameCommand -annotation "Activate Select Cluster Mode (Press)"
- -command ("SelectClusterActivate")
- SelectCluster_in_Jasper;
-
- nameCommand -annotation "Deactivate Select Cluster Mode (Release)"
- -command ("SelectClusterDectivate")
- SelectCluster_in_Jasper_release;
-
- // named commands for activating/deactivating screen sliders
- //
- nameCommand -annotation "Activate Modify Lower Brush Radius (Press) / Modify Paint Effects Brush Size"
- -command ("ModifyLowerRadiusPress")
- ModifyLowerRadius_in_Jasper;
-
- nameCommand -annotation "Deactivate Modify Lower Brush Radius (Release)"
- -command ("ModifyLowerRadiusRelease")
- ModifyLowerRadius_in_Jasper_release;
-
- nameCommand -annotation "Activate Modify Upper Brush Radius (Press) / Modify Paint Effect Brush Scale"
- -command ("ModifyUpperRadiusPress")
- ModifyUpperRadius_in_Jasper;
-
- nameCommand -annotation "Deactivate Modify Upper Brush Radius (Release)"
- -command ("ModifyUpperRadiusRelease")
- ModifyUpperRadius_in_Jasper_release;
-
- nameCommand -annotation "Activate Modify Max Displacement (Press) / Modify Paint Effect Surface Offset"
- -command ("ModifyDisplacementPress")
- ModifyDisplacement_in_Jasper;
-
- nameCommand -annotation "Deactivate Modify Max Displacement (Release)"
- -command ("ModifyDisplacementRelease")
- ModifyDisplacement_in_Jasper_release;
-
- nameCommand -annotation "Activate Modify Opacity (Press)"
- -command ("ModifyOpacityPress")
- ModifyOpacity_in_Jasper;
-
- nameCommand -annotation "Deactivate Modify Opacity (Release)"
- -command ("ModifyOpacityRelease")
- ModifyOpacity_in_Jasper_release;
-
- nameCommand -annotation "Activate Modify Value (Press)"
- -command ("ModifyValuePress")
- ModifyValue_in_Jasper;
-
- nameCommand -annotation "Deactivate Modify Value (Release)"
- -command ("ModifyValueRelease")
- ModifyValue_in_Jasper_release;
-
- nameCommand -annotation "Activate Modify Reflection Isoparm (Press)"
- -command ("ModifyReflectionIsoparmPress")
- ModifyReflIsoparm_in_Jasper;
-
- nameCommand -annotation "Deactivate Modify Reflection Isoparm (Release)"
- -command ("ModifyReflectionIsoparmRelease")
- ModifyReflIsoparm_in_Jasper_release;
-
- nameCommand -annotation "Activate Modify Target (Press)"
- -command ("ModifiyTargetPress")
- GlobalScreenSlider_in_Jasper;
-
- nameCommand -annotation "Deactivate Modify Target (Release)"
- -command ("ModifiyTargetRelease")
- GlobalScreenSlider_in_Jasper_release;
-
- nameCommand -annotation "Set Modify Target, with Marking Menu (Press)"
- -command ("ModifyTargetMarkingMenu")
- setGlobalScreenSliderMode_in_Jasper;
-
- nameCommand -annotation "Set Modify Target, with Marking Menu (Release)"
- -command ("ModifyTargetMarkingMenuPopDown")
- setGlobalScreenSliderMode_in_Jasper_revert;
-
- nameCommand -annotation "Activate Modify Sculpt Reference Vector (Press)"
- -command ("ModifySculptReferenceVectorMarkingMenu")
- setPuttyReferenceVector_in_Jasper;
-
- nameCommand -annotation "Deactivate Modify Sculpt Reference Vector (Release)"
- -command ("ModifySculptReferenceVectorMarkingMenuPopDown")
- setPuttyReferenceVector_in_Jasper_release;
- }
-
-
- // ---------------------------------------------------------------
- // obsolete functions - keeping them for backwards compatibility
- // ---------------------------------------------------------------
-
- global proc puttyBrushMode( )
- {
- string $currentContext = `currentCtx`;
- string $currentTool = `contextInfo -c $currentContext`;
-
- if ( $currentTool == "putty" ) {
- deletePopupMenu();
-
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "N" -l "Pull"
- -c ("puttyCtx -e -mtm " + " \"pull\" `currentCtx`");
- menuItem -rp "S" -l "Push"
- -c ("puttyCtx -e -mtm " + " \"push\" `currentCtx`");
- menuItem -rp "W" -l "Smooth"
- -c ("puttyCtx -e -mtm " + " \"smooth\" `currentCtx`");
- menuItem -rp "E" -l "Erase"
- -c ("puttyCtx -e -mtm " + " \"erase\" `currentCtx`");
- setParent -m ..;
- }
- }
-
- global proc selectBrushMode( )
- {
- string $currentContext = `currentCtx`;
- string $currentTool = `contextInfo -c $currentContext`;
-
- if ( $currentTool == "selectPaint" ) {
- deletePopupMenu();
-
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "N" -l "Toggle"
- -c ("selectPaintCtx -e -st " + " \"toggle\" `currentCtx`");
- menuItem -rp "W" -l "Select"
- -c ("selectPaintCtx -e -st " + " \"select\" `currentCtx`");
- menuItem -rp "E" -l "UnSelect"
- -c ("selectPaintCtx -e -st " + " \"unselect\" `currentCtx`");
- setParent -m ..;
- }
- }
-
- global proc userPaintBrushMode( )
- {
- string $currentContext = `currentCtx`;
- string $currentTool = `contextInfo -c $currentContext`;
-
- if ( $currentTool == "userPaint" ) {
- deletePopupMenu();
-
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "E" -l "Replace"
- -c ("userPaintCtx -e -et " + " \"absolute\" `currentCtx`");
- menuItem -rp "N" -l "Add"
- -c ("userPaintCtx -e -et " + " \"additive\" `currentCtx`");
- menuItem -rp "S" -l "Scale"
- -c ("userPaintCtx -e -et " + " \"scale\" `currentCtx`");
- menuItem -rp "W" -l "Smooth"
- -c ("userPaintCtx -e -et " + " \"smooth\" `currentCtx`");
- setParent -m ..;
- }
- }
-
- global proc attrPaintBrushMode( )
- {
- string $currentContext = `currentCtx`;
- string $currentTool = `contextInfo -c $currentContext`;
-
- if ( $currentTool == "attrPaint" || attrPaintInstCheckTool($currentTool) ) {
- deletePopupMenu();
-
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "E" -l "Replace"
- -c ("attrPaintCtx -e -et " + " \"absolute\" `currentCtx`");
- menuItem -rp "N" -l "Add"
- -c ("attrPaintCtx -e -et " + " \"additive\" `currentCtx`");
- menuItem -rp "S" -l "Scale"
- -c ("attrPaintCtx -e -et " + " \"scale\" `currentCtx`");
- menuItem -rp "W" -l "Smooth"
- -c ("attrPaintCtx -e -et " + " \"smooth\" `currentCtx`");
- setParent -m ..;
- }
- }
-
- global proc weightPaintBrushMode( )
- {
- string $currentContext = `currentCtx`;
- string $currentTool = `contextInfo -c $currentContext`;
-
- if ( $currentTool == "wtPaint" ) {
- deletePopupMenu();
-
- popupMenu -mm 1 -b 1 -p viewPanes tempMM;
- menuItem -rp "E" -l "Replace"
- -c ("wtPaintCtx -e -et " + " \"absolute\" `currentCtx`");
- menuItem -rp "N" -l "Add"
- -c ("wtPaintCtx -e -et " + " \"additive\" `currentCtx`");
- menuItem -rp "S" -l "Scale"
- -c ("wtPaintCtx -e -et " + " \"scale\" `currentCtx`");
- menuItem -rp "W" -l "Smooth"
- -c ("wtPaintCtx -e -et " + " \"smooth\" `currentCtx`");
- setParent -m ..;
- }
- }
-